﻿#ifndef MINER_H
#define MINER_H

#pragma once

#include <cstring>
#include <cassert>

#include "BaseGameEntity.h"
#include "Location.h"
//sdas




const int ComfortLevel		=5;
const int MaxNuggets		=3;
const int ThirstLevel		=5;
const int TirednessThreshold=5;

class State;

class Miner : public BaseGameEntity
{
private:
	State*			m_pCurrentState;

	location_type	m_Location;

	int				m_iGoldCarried;

	int				m_iMoneyInBank;

	int				m_iThirst;

	int				m_iFatigue;
public:
	Miner(int id); //constructor
	
	void Update(); // most Importance function 

	void ChangeState (State * new_state); // để chuyển sang state khác

	location_type  Location() const { return m_Location;} // trả về Location hiện tại
	void ChangeLocation (const location_type loc) { m_Location = loc;} // set Location

	// methods of Gold
	int		GoldCarried() const {return m_iGoldCarried;}
	void	SetGoldCarried(const int val) {m_iGoldCarried =val;}
	void	AddToGoldCarried(const int val);
	bool	IsPocketFull() const {return m_iGoldCarried >=MaxNuggets;}

	// methos of Fatigue
	bool	Fatigued()const;
	void	DecreaseFatigue() {m_iFatigue -=1;}
	void	IncreaseFatidue() {m_iFatigue +=1;}

	// methods of Money
	int		Wealth()const {return m_iMoneyInBank;}
	void	SetWealth(const int val) {m_iMoneyInBank = val;}
	void	AddToWealth(const int val);

	// methods of Thirsty
	bool	Thirsty()const;
	void	BuyAndDrink() {m_iThirst =0; m_iMoneyInBank -=1;}
	
};

#endif